{template 'header'}
<style>
	body{}
    .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
	/*个人中心*/
	.pcenter-main .head{position:relative; height:170px; width:100%; background:url('resource/images/head-bg.png') no-repeat center center; background-size:100% auto; -moz-background-size:100% auto; -webkit-background-size:100% auto;}
	.pcenter-main .head .pdetail{height:120px; padding:30px 0 0 20px; -webkit-box-sizing:border-box;}
	.pcenter-main .head .pdetail .img-circle{float:left; width:66px; height:66px; overflow:hidden; margin-right:10px; border:1px rgba(255,255,255,0.2) solid;}
	.pcenter-main .head .pdetail .img-circle img{width:66px;}
	.pcenter-main .head .pdetail .pull-left span{display:block; color:#FFF; line-height:20px;}
	.pcenter-main .head .pdetail .pull-left span.name{font-size:20px; display:inline-block; max-width:150px; height:25px; line-height:25px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; word-break:keep-all;}
	.pcenter-main .head .pdetail .pull-left span.type{font-size:14px;}
	.pcenter-main .head .head-nav{height:50px; line-height:20px; padding-top:7px; background:rgba(0,0,0,0.2);}
	.pcenter-main .head .head-nav .head-nav-list{display:inline-block; float:left; text-decoration:none; color:#FFF;  width:25%; text-align:center; font-size:16px; background:-webkit-gradient(linear, 0 0, 0 100, from(rgba(255,255,255,0.5)), to(rgba(255,255,255,0.5)) ) no-repeat left center; -webkit-background-size:1px 75%;}
	.pcenter-main .head .head-nav .head-nav-list:first-child{background:none;}
	.pcenter-main .head .head-nav .head-nav-list > span{font-weight:bold; display:block; font-size:14px;}
	/*竖排导航条 通用*/
	.mnav-box ul{padding:10px 15px 0 15px;font-family:Helvetica, Arial, sans-serif;}
	.mnav-box ul li{padding:10px 15px;}
	.pcenter-main .profile{width:100%;background:transparent url('resource/images/home-bg.jpg') no-repeat; background-size:cover;}
	.pcenter-main .profile .tabbable>ul{padding:10px 15px 0px 15px;}
	.pcenter-main .profile .tabbable .nav-tabs>li.active>a, .nav-tabs>li.active>a:hover, .nav-tabs>li.active>a:focus{color:#5ac5d4;background-color:#E9F7F8;}
	.pcenter-main .profile label{color:#555; font-weight:lighter; margin-top:5px;}
	.pcenter-main .rank-list-wrap {margin: 15px 5px;}
	.pcenter-main .btn-group-top {width: 100%;}
	.pcenter-main .btn-default {width: 33.33%;}
	.pcenter-main .rank-list-wrap table td {border-color:#ececec; text-align: center;}
	.pcenter-main .rank-list-wrap table th {border-top-width:0;text-align: center;}
	.pcenter-main .rank-list-wrap .rank1 {background-color:#e43600;}
	.pcenter-main .rank-list-wrap .rank2 {background-color:#ff7c00;}
	.pcenter-main .rank-list-wrap .rank3 {background-color:#2baf0f;}
	.pcenter-main .rank-list-wrap .rankx {background-color:#ccc;}
	.ad_wrap {margin: 5px 5px 0 5px;}
    .sign_rule{color: white; float: right; margin-right: 20px}
</style>
<div class="pcenter-main">
	<div class="head clearfix">
		<div class="pdetail">
			<div class="img-circle">
				<a href="{php echo url('mc/profile')}">
					<img src="{php echo tomedia($member['avatar']);}" onerror="this.src='resource/images/heading.jpg'">
				</a>
			</div>
			<div style="line-height: 66px; font-size: 16px;">
				<span class="name">
					{if $member['nickname']!=''}
					<a href="{php echo url('mc/profile')}" style="color: #fff">{$member['nickname']}</a>
					{else}
					<a href="{php echo url('mc/profile')}" style="color: #f00;">设置昵称</a>
					{/if}
				</span>
                <span class="sign_rule">
                    {if $this->setting['base']['sign_rule'] != ''}
                    <div data-toggle="modal" data-target="#signRuleModal" style="cursor: pointer;">签到规则</div>
                    {/if}
                </span>
			</div>
		</div>
        <div class="modal fade" id="signRuleModal" tabindex="-1" role="dialog" aria-labelledby="signRuleModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="signRuleModalLabel">签到规则</h4>
                    </div>
                    <div class="modal-body">
                        {if $this->setting['base']['sign_rule'] != ''}
                        <div class="popup sign_popup">
                            <div class="content-block">
                                {php echo htmlspecialchars_decode($this->setting['base']['sign_rule']);}
                            </div>
                        </div>
                        {/if}
                    </div>

                </div>
            </div>
        </div>

		<div class="head-nav">
			<a class="head-nav-list" href="javascript:;">今日排名<span>{$today_rank}</span></a>
			<a class="head-nav-list" href="javascript:;">今日奖励<span>{if $current['reward']!=''}{$current['reward']}{/if}</span></a>
			<a class="head-nav-list" href="javascript:;">连续签到<span>{if $current['continue_total']!=''}{$current['continue_total']}{/if}</span></a>
			<a class="head-nav-list" href="javascript:;">累计签到<span>{if $current['total']!=''}{$current['total']}{/if}</span></a>
		</div>
	</div>

	{if $this->setting['ad']['position']=='top' && !empty($this->setting['ad']['content'])}
	<div class="ad_wrap">
		{php echo htmlspecialchars_decode($this->setting['ad']['content'])}
	</div>
	{/if}

	<div class="rank-list-wrap">
		<div class="btn-group-top-box">
			<div class="btn-group btn-group-top">
				<a href="{php echo $this->createMobileUrl('home', array('rank' => 'today', 'rid' => $rid));}" class="btn btn-default {if $rank=='today'}active{/if}">今日排行榜</a>
				<a href="{php echo $this->createMobileUrl('home', array('rank' => 'all', 'rid' => $rid));}" class="btn btn-default {if $rank=='all'}active{/if}">总排行榜</a>
				<a href="{php echo $this->createMobileUrl('home', array('rank' => 'credit', 'rid' => $rid));}" class="btn btn-default {if $rank=='credit'}active{/if}">{php echo empty($credit_title)?'积分':$credit_title;}排行榜</a>
			</div>
		</div>
		{if $rank == 'today'}
		<table class="table">
			{if $list}
			<tr>
				<th width="50">排名</th>
				<th>昵称</th>
				<th width="110">奖励</th>
				<th width="72">签到时间</th>
			</tr>
			{loop $list $li}
			<tr>
				<td>
					<span class="badge rank{if $li['index']<=3}{$li['index']}{else}x{/if}">{$li['index']}</span>
				</td>
				<td>
					{if $li['nickname']!=''}{$li['nickname']}{else}{$li['uid']}{/if}
				</td>
				<td>
					{$li['reward']}
				</td>
				<td>
					{$li['time']}{if $this->setting['base']['show_millisecond']}.{$li['millisecond']}{/if}
				</td>
			</tr>
			{/loop}
			{else}
			<tr>
				<th colspan="4" style="font-weight: normal;">
					<p style="text-align: center;color: #ccc;">还没有排行榜数据，休息一会再来<a style="color: #aaa;text-decoration: underline" href="javascript:;" onclick="window.location.reload()">刷新</a></p>
				</th>
			</tr>
			{/if}
		</table>
		{/if}

		{if $rank == 'all'}
		<table class="table">
			{if $list}
			<tr>
				<th>排名</th>
				<th>昵称</th>
				<th>签到总天数</th>
			</tr>
			{loop $list $li}
			<tr>
				<td>
					<span class="badge rank{if $li['index']<=3}{$li['index']}{else}x{/if}">{$li['index']}</span>
				</td>
				<td>
					{if $li['nickname']!=''}{$li['nickname']}{else}{$li['uid']}{/if}
				</td>
				<td>
					{$li['total']}
				</td>
			</tr>
			{/loop}
			{else}
			<tr>
				<th colspan="4" style="font-weight: normal;">
					<p style="text-align: center;color: #ccc;">还没有排行榜数据，休息一会再来<a style="color: #aaa;text-decoration: underline" href="javascript:;" onclick="window.location.reload()">刷新</a></p>
				</th>
			</tr>
			{/if}
		</table>
		{/if}

		{if $rank == 'credit'}
		<table class="table">
			{if $list}
			<tr>
				<th>排名</th>
				<th>昵称</th>
				<th>{php echo empty($credit_title)?'积分':$credit_title;}</th>
			</tr>
			{loop $list $li}
			<tr>
				<td>
					<span class="badge rank{if $li['index']<=3}{$li['index']}{else}x{/if}">{$li['index']}</span>
				</td>
				<td>
					{if $li['nickname']!=''}{$li['nickname']}{else}{$li['uid']}{/if}
				</td>
				<td>
					{$li['credit']}
				</td>
			</tr>
			{/loop}
			{else}
			<tr>
				<th colspan="4" style="font-weight: normal;">
					<p style="text-align: center;color: #ccc;">还没有排行榜数据，休息一会再来<a style="color: #aaa;text-decoration: underline" href="javascript:;" onclick="window.location.reload()">刷新</a></p>
				</th>
			</tr>
			{/if}
		</table>
		{/if}

	</div>

	{if $this->setting['ad']['position']=='bottom' && !empty($this->setting['ad']['content'])}
	<div class="ad_wrap">
		{php echo htmlspecialchars_decode($this->setting['ad']['content'])}
	</div>
	{/if}
</div>
<!--<nav class="navbar navbar-default navbar-fixed-bottom">
	<div class="container" style="text-align: center">
		<button type="button" style="width: 50%" class="btn btn-success navbar-btn">分享</button>
	</div>
</nav>-->
{template 'footer'}